
package com.nd.rj.common.util.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteDatabase.CursorFactory;
import android.database.sqlite.SQLiteOpenHelper;

/**
 * @ClassName: SqliteHelper
 * @Description: SQLiteOpenHelper(为了实现onUpgrade)
 * @author Administrator
 * @date 2012-2-1 下午01:56:47
 */
public class SqliteHelper extends SQLiteOpenHelper {

    private IDataBaseRef mDataBaseRef;

    public SqliteHelper(Context context, String name, CursorFactory factory, int version,
            IDataBaseRef dbRef) {
        super(context, name, factory, version);
        mDataBaseRef = dbRef;
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        mDataBaseRef.onUpgrade(db, oldVersion, newVersion);
    }

    @Override
    public void onOpen(SQLiteDatabase db) {
        super.onOpen(db);
        mDataBaseRef.onCreate(db);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {

    }

}
